<tagLib name="html" />
<include file="Public:header" />
<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.4.4.min.js"></script>
<link href="__PUBLIC_/Css/ui-base/jquery.ui.base.css" rel="stylesheet" type="text/css"/>
<script src="__PUBLIC__/Js/jquery-ui-1.8.11.custom.min.js"></script>
<div id="main" class="main" >
<script language="JavaScript">
<!--
jQuery(document).ready(function(){
    /*$('#totalprice').click(
    function (){
        var amount = $(':checkbox[name:room_id]:checked').length;
        var house_id = $('#house_id').val();
        var start_time = $("input[name='start_time']").val();
        var end_time = $("input[name='end_time']").val();
        $('#room_num').attr('value', amount);
        jQuery.post(URL+'/calPrice',
        {house_id:house_id,
         amount:amount,
         start_time:start_time,
         end_time:end_time
        },
        function(msg){
            $('#totalprice').attr('value',msg);
        },
        'text')
    }
    );*/

     $( "#member" ).autocomplete({
			source: URL+"/getAllMember",
			minLength: 1,
			select: function( event, ui ) {
				//log( ui.item ?"Selected: " + ui.item.value + " aka " + ui.item.id :"Nothing selected, input was " + this.value );
                                $('#member_id').attr('value',ui.item.id);
                    }
		});
});
//-->
</script>
<div class="content">
    <form method='post' id="form1" action="__URL__/update/" >
<div class="title">修改预订单 [ <input type="submit" value="保 存" class="small submit"> <a href="__URL__">返回列表</a>    <a href="__APP__/Housestats">返回房态</a>]
    <b style="margin-left:10px;">操作人</b>：{$vo.user_id|getModelName=User,nickname}
</div>
<table cellpadding=3 cellspacing=3>
<tr>
	<td class="tRight" ><span class="red">*</span>预订单号：</td>
	<td class="tLeft" >{$vo.order_no}
        <eq name="_REQUEST.return" value="home">
            <input type="hidden" name="jumpUrl" value="__APP__/Public/main">
        </eq> 
            <input type="hidden" name="order_no" class="huge" value="{$vo.order_no}" >
        </td>
</tr>
<tr>
	<td class="tRight" ><span class="red">*</span>预订人：</td>
	<td class="tLeft" >
            <input type="hidden" id="member_id" name="member_id" value="{$vo.member_id}" >
            <a href="__APP__/Member/edit/id/{$vo.member_id}" target="_blank" >{$vo.member_id|getModelName=Member,account}( {$vo.member_id|getModelName=Member,name} )</a>
        </td>
</tr>
<tr>
	<td class="tRight" >预订房间：</td>
	<td class="tLeft" >
            <php>
                $hotel_ids = getModelName($vo['house_id'],house,hotel_id);
            </php>
            <select name="hotel" style="width:200px;" onchange="modifyHouse(this);">
                <volist name="hotel" id="ht">
                    <option value="{$ht.id}" <eq name="hotel_ids" value="$ht.id"> selected </eq> >{$ht.name}</option>
                </volist>
            </select>
            {$vo.house_id|makeHouse}  {$vo.room_id|makeRoom}
        </td>
</tr>
<load href="__PUBLIC__/Js/My97DatePicker/WdatePicker.js" />
<tr>
	<td class="tRight" ><span class="red">*</span>入住：</td>
	<td class="tLeft" ><input type="text" class="easyui-datetimebox" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="start_time"  value="{$vo.start_time|toDate}">
             &nbsp;&nbsp;<span class="red">*</span>离开：
            <input type="text" class="medium bLeft easyui-datetimebox" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" name="end_time" id="end_time" value="{$vo.end_time|toDate}">
        </td>
</tr>
<tr>
    <td class="tRight" >预订房间数：</td>
	<td class="tLeft" ><input type="text" id="room_num" name="room_num"  value="{$vo.room_num}">
        </td>
</tr>
<tr>
	<td class="tRight" >总金额：</td>
	<td class="tLeft" >			
            <input type="text" class="medium bLeft" id="totalprice" name="totalprice" value="{$vo.totalprice|getPriceRow}">
        </td>
</tr>
<tr>
	<td class="tRight" >入住人数：</td>
	<td class="tLeft" >
            <input type="text" class="medium bLeft" name="person_num" value="{$vo.person_num}"></td>
</tr>
<tr>
	<td class="tRight" >入住人姓名：</td>
	<td class="tLeft" ><input type="text" class="huge bLeft" name="cust_name" value="{$vo.cust_name}"></td>
</tr>
<tr>
	<td class="tRight" >入住人电话：</td>
	<td class="tLeft" ><input type="text" class="large bLeft" name="cust_phone" value="{$vo.cust_phone}"></td>
</tr>
<tr>
	<td class="tRight" >定金：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="advance_pay" value="{$vo.advance_pay}"></td>
</tr>
<tr>
	<td class="tRight" >留言：</td>
        <td class="tLeft" ><textarea cols="57" rows="7" name="comment" >{$vo.comment}</textarea></td>
</tr>
<tr>
	<td class="tRight" >支付方式：</td>
	<td class="tLeft" ><input type="text" class="medium bLeft" name="paymethod_id" value="{$vo.paymethod_id}"></td>
</tr>

<tr>
	<td class="tRight tTop">备注说明：</td>
	<td class="tLeft"><textarea class="large bLeft"  name="remark" rows="5" cols="57" > {$vo.remark}</textarea></td>
</tr>
<tr>
	<td class="tRight">订单状态：</td>
	<td class="tLeft">
            <select class="middle bLeft"  name="status">
                <volist name="orderStatus" id="os">
                    <option value="{$key}" <eq name="vo.status" value="$key">selected</eq> >{$os}</option>
                </volist>
            </select>
        </td>
</tr>
<tr>
	<td></td>
	<td class="center">
            <input type="hidden" name="id" value="{$vo.id}">
            <input type="submit" value="保 存" class="small submit">
            <input type="reset" class="reset imgButton" onclick="javascript:history.back()" value="返回" >
            <a class="small submit" href="__APP__/Checkin/add/orderid/{$vo.id}/start_time/{$vo.start_time|toDate}/end_time/{$vo.end_time|toDate}" target="_blank">生成入住单</a>
	</td>
</tr>
</table>
</form>
</div>
</div>
<php>

    function getPriceRow($price){
			if($price>0)
            {
            	echo $price; 
            }
    }

</php>